<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gamvas.ActorState</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.51 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="gamvas.ActorState"></a>gamvas.<wbr>ActorState</h1><div class=CBody><h4 class=CHeading>Description</h4><p>A class for actor states</p><p>ActorState is the brain of a actor.&nbsp; Every actor has a default ActorState, that you can use for your logic by using <a href="gamvas-actor-js.html#gamvas.Actor.getCurrentState" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">gamvas.Actor.getCurrentState</a> or you could add own states for different situations, for example a soldier ai could have states like patrol, detect, follow, fight</p><h4 class=CHeading>Constructor</h4><p>new gamvas.ActorState(name)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>a unique state name within the actor</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#gamvas.ActorState" >gamvas.<wbr>ActorState</a></td><td class=SDescription>A class for actor states</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.ActorState.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.name" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">name</a></td><td class=SDescription>The name of the actor state</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.ActorState.actor" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">actor</a></td><td class=SDescription>The actor the state is assigned to, or null if not assigned</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.ActorState.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.init" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">init</a></td><td class=SDescription>Gets called once on state initialization. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.enter" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">enter</a></td><td class=SDescription>Gets called when the state is entered.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.leave" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">leave</a></td><td class=SDescription>Gets called when the state is left.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.preDraw" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">preDraw</a></td><td class=SDescription>Gets called after screen clear and before camera handling. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.draw" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">draw</a></td><td class=SDescription>Gets called when the state should draw. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.postDraw" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">postDraw</a></td><td class=SDescription>Gets called after camera handling. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.update" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">update</a></td><td class=SDescription>Update the ai. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onKeyDown" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">onKeyDown</a></td><td class=SDescription>A key on the keyboard was pressed</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.onKeyUp" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">onKeyUp</a></td><td class=SDescription>A key on the keyboard was released</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onMouseDown" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">onMouseDown</a></td><td class=SDescription>A mouse button was pressed</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.onMouseUp" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">onMouseUp</a></td><td class=SDescription>A mouse button was released</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onMouseMove" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">onMouseMove</a></td><td class=SDescription>The mouse was moved</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.onTouchDown" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">onTouchDown</a></td><td class=SDescription>A finger starts touching the display</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onTouchUp" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">onTouchUp</a></td><td class=SDescription>A finger stopped touching the display</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.onTouchMove" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">onTouchMove</a></td><td class=SDescription>A finger is sliding over the surface</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onCollision" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">onCollision</a></td><td class=SDescription>The actor starts a collision with another actor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.onCollisionEnter" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">onCollisionEnter</a></td><td class=SDescription>The actor starts a collision with another actor</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.ActorState.onCollisionLeave" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">onCollisionLeave</a></td><td class=SDescription>The actor leaves a collision with another actor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.ActorState.doCollide" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">doCollide</a></td><td class=SDescription>This function is called to check of two objects should collide. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.name"></a>name</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote><p>The name of the actor state</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.actor"></a>actor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.actor</td></tr></table></blockquote><p>The actor the state is assigned to, or null if not assigned</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.init"></a>init</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called once on state initialization.&nbsp; Overwrite with code that needs to be done one, like resource loading.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.enter"></a>enter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">enter: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called when the state is entered.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.leave"></a>leave</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">leave: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called when the state is left.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.preDraw"></a>preDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called after screen clear and before camera handling.&nbsp; Use this for example for static background elements that do not move with the camera.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.draw"></a>draw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called when the state should draw.&nbsp; In most cases you would not overwrite this function.&nbsp; If you put logic like ai in a actor, overwrite the update function.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.ActorState.update" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt9', 'link23')" onMouseOut="HideTip('tt9')">gamvas.ActorState.update</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.postDraw"></a>postDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called after camera handling.&nbsp; Use this to render static things in the screen forground, like score or health.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.update"></a>update</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>update: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Update the ai.&nbsp; Overwrite with things your actor should do on a per frame basis.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onKeyDown"></a>onKeyDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyDown: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A key on the keyboard was pressed</p><h4 class=CHeading>Note</h4><p>Requires the actor to be registered with <a href="gamvas-state-state-js.html#gamvas.State.registerInputEvents" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt23', 'link24')" onMouseOut="HideTip('tt23')">gamvas.State.registerInputEvents</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>keyCode</td><td class=CDLDescription>The keycode of the key (e.g. gamvas.key.RETURN)</td></tr><tr><td class=CDLEntry>character</td><td class=CDLDescription>The actual character (e.g.&nbsp; &lsquo;a&rsquo;)</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-state-state-js.html#gamvas.State.registerInputEvents" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt23', 'link25')" onMouseOut="HideTip('tt23')">gamvas.State.registerInputEvents</a> <a href="#gamvas.ActorState.onKeyUp" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt11', 'link26')" onMouseOut="HideTip('tt11')">gamvas.ActorState.onKeyUp</a></p><h4 class=CHeading>Example</h4><blockquote><pre>myActorState = gamvas.ActorState.extend({
    onKeyDown: function(keyCode) {
        if (keyCode == gamvas.key.SPACE) {
            this.firePlayerGun();
        }
    },
    firePlayerGun() {
        console.log('BAZOING!');
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onKeyUp"></a>onKeyUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyUp: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A key on the keyboard was released</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>keyCode</td><td class=CDLDescription>The keycode of the key (e.g. gamvas.key.RETURN)</td></tr><tr><td class=CDLEntry>character</td><td class=CDLDescription>The actual character (e.g.&nbsp; &lsquo;a&rsquo;)</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.ActorState.onKeyDown" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt10', 'link27')" onMouseOut="HideTip('tt10')">gamvas.ActorState.onKeyDown</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onMouseDown"></a>onMouseDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseDown: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A mouse button was pressed</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>button</td><td class=CDLDescription>The mouse button that was pressed (e.g. gamvas.mouse.LEFT)</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position on the screen the mousepointer was while pressed</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-mouse-js.html#gamvas.mouse" class=LClass id=link28 onMouseOver="ShowTip(event, 'tt24', 'link28')" onMouseOut="HideTip('tt24')">gamvas.mouse</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onMouseUp"></a>onMouseUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseUp: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A mouse button was released</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>button</td><td class=CDLDescription>The mouse button that was released (e.g. gamvas.mouse.LEFT)</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position on the screen the mousepointer was while released</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-mouse-js.html#gamvas.mouse" class=LClass id=link29 onMouseOver="ShowTip(event, 'tt24', 'link29')" onMouseOut="HideTip('tt24')">gamvas.mouse</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onMouseMove"></a>onMouseMove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseMove: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The mouse was moved</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position where the mousecursor was</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myActorState = gamvas.ActorState.extend({
    onMouseMove: function(x, y) {
       this.followPosition(x, y);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onTouchDown"></a>onTouchDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchDown: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger starts touching the display</p><h4 class=CHeading>Description</h4><p>The id is a integer representing the finger used.&nbsp; Starts with 0 next finger would be 1, if the first finger would be removed from the display and another finger will be added, the new finger would become id 0 again, as id 0 was not used anymore, when the new finger was added</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onTouchUp"></a>onTouchUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchUp: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger stopped touching the display</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onTouchMove"></a>onTouchMove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchMove: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger is sliding over the surface</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onCollision"></a>onCollision</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollision: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ni,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ti,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The actor starts a collision with another actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the colliding actor</td></tr><tr><td class=CDLEntry>ni</td><td class=CDLDescription>the normal impulse (aka how hard did we hit)</td></tr><tr><td class=CDLEntry>ti</td><td class=CDLDescription>the tangent impulse (how much rotational force did we get out of the collision)</td></tr><tr><td class=CDLEntry>c</td><td class=CDLDescription>a b2Contact object holding low level information about the contact</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actorstate.onCollisionEnter&gt; &lt;gamvas.actorstate.onCollisionLeave&gt;</p><h4 class=CHeading>Example</h4><blockquote><pre>spaceShipFlying = gamvas.ActorState.extend({
    onCollision: function(a, ni) {
        if ( (a.type == &quot;asteroid&quot;) &amp;&amp; (ni &gt; 15) ) {
            console.log(&quot;here is your captain speaking, we got hit hard by a asteroid... abandon ship!&quot;);
        }
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onCollisionEnter"></a>onCollisionEnter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollisionEnter: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The actor starts a collision with another actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the colliding actor</td></tr><tr><td class=CDLEntry>c</td><td class=CDLDescription>a b2Contact object holding low level information about the contact</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actorstate.onCollisionEnter&gt;</p><h4 class=CHeading>Example</h4><blockquote><pre>myActorState = gamvas.ActorState.extend({
    onCollisionEnter: function(a) {
        console.log(&quot;i got hit by &quot;+a.name);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.onCollisionLeave"></a>onCollisionLeave</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollisionLeave: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The actor leaves a collision with another actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the colliding actor</td></tr><tr><td class=CDLEntry>c</td><td class=CDLDescription>a b2Contact object holding low level information about the contact</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actorstate.onCollisionEnter&gt;</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.ActorState.doCollide"></a>doCollide</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>doCollide: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>om</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>This function is called to check of two objects should collide.&nbsp; If one of the two objects returns false, the collision between the two objects will be ignored.</p><p>This is a important function for creating jump and run games.&nbsp; On collision with so called cloud objects - which are typical jump and run objects that you can for example jump through from below but not fall down when standing on them, you would check if you jump upwards, then disable the collision, or if you fall downwards and are positioned above the colliding object, you would enable the collision.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the colliding actor</td></tr><tr><td class=CDLEntry>c</td><td class=CDLDescription>a b2Contact object holding low level information about the contact</td></tr><tr><td class=CDLEntry>om</td><td class=CDLDescription>the old b2Manifold object holding information about the collision points</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actorstate.onCollisionEnter&gt;</p><h4 class=CHeading>Example</h4><p>Do not collide with ghost objects</p><blockquote><pre>myActorState = gamvas.ActorState.extend({
    doCollide: function(opponent) {
        if (opponent.type == &quot;ghost&quot;) {
            return false;
        }
        return true;
    }
});</pre></blockquote></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="gamvas-base-js.html">gamvas</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-actor-js.html">gamvas.<wbr>Actor</a></div></div><div class=MEntry><div class=MFile id=MSelected>gamvas.<wbr>ActorState</div></div><div class=MEntry><div class=MFile><a href="gamvas-animation-js.html">gamvas.<wbr>Animation</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astar-js.html">gamvas.<wbr>AStar</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargrid-js.html">gamvas.<wbr>AStarGrid</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargridnode-js.html">gamvas.<wbr>AStarGridNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarmap-js.html">gamvas.<wbr>AStarMap</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarnode-js.html">gamvas.<wbr>AStarNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-camera-js.html">gamvas.<wbr>Camera</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-class-js.html">gamvas.<wbr>Class</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-config-js.html">gamvas.<wbr>config</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-dom-js.html">gamvas.dom</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-event-js.html">gamvas.<wbr>event</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-image-js.html">gamvas.<wbr>Image</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-key-js.html">gamvas.key</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-math-js.html">gamvas.math</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-mouse-js.html">gamvas.<wbr>mouse</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-particleemitter-js.html">gamvas.<wbr>ParticleEmitter</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-js.html">gamvas.<wbr>physics</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-userdata-js.html">gamvas.<wbr>physics.<wbr>UserData</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-rect-js.html">gamvas.Rect</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-resource-js.html">gamvas.<wbr>Resource</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-screen-js.html">gamvas.<wbr>screen</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-sound-js.html">gamvas.<wbr>Sound</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-js.html">gamvas.<wbr>state</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-state-js.html">gamvas.<wbr>State</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-timer-js.html">gamvas.<wbr>timer</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-vector2d-js.html">gamvas.<wbr>Vector2D</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Macros.html">Macros</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Macros">Macros</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([], 2);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote>The name of the actor state</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.actor</td></tr></table></blockquote>The actor the state is assigned to, or null if not assigned</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote>Gets called once on state initialization. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">enter: function()</td></tr></table></blockquote>Gets called when the state is entered.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">leave: function()</td></tr></table></blockquote>Gets called when the state is left.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called after screen clear and before camera handling. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called when the state should draw. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called after camera handling. </div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>update: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Update the ai. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyDown: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A key on the keyboard was pressed</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyUp: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A key on the keyboard was released</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseDown: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A mouse button was pressed</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseUp: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A mouse button was released</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseMove: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The mouse was moved</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchDown: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger starts touching the display</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchUp: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger stopped touching the display</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchMove: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger is sliding over the surface</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollision: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ni,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ti,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The actor starts a collision with another actor</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollisionEnter: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The actor starts a collision with another actor</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onCollisionLeave: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The actor leaves a collision with another actor</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>doCollide: function(</td><td class="PParameter  prettyprint " nowrap>a,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>c,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>om</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>This function is called to check of two objects should collide. </div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getCurrentState: function()</td></tr></table></blockquote>Get the current gamvas.ActorState the actor is in</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>registerInputEvents: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Send keyboard/mouse events to gamvas.Actor onKeyDown and similar functions</div></div><div class=CToolTip id="tt24"><div class=CClass>Information and functions for the mouse.</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>